/**
 * @(#)com.basic.collection.TreeSetTest
 *
 * Copyright (c) 2014-2018 上海纬视瑞科技有限公司
 *
 * DESC:
 *
 */
package com.basic.collection;

import com.basic.demo.domain.Demo;

import java.util.Iterator;
import java.util.Set;
import java.util.TreeSet;

/**
 * @author fusf
 * @version 1.0  2017/3/14
 */
public class TreeSetTest {

    /*public static void main(String[] args) {
        Set set = new TreeSet();
        set.add(1);
        set.add(15);
        set.add(13);
        set.add(132);
        set.add(133);
        set.add(145);
        set.add(1459);

      Iterator it=  set.iterator();
        while(it.hasNext()){
            System.out.println(it.next());
        }

    }*/


    public static void main(String[] args) {
        Set set = new TreeSet();
        set.add(new Demo(1L,"job"));
        set.add(new Demo(2L,"job2"));
        set.add(new Demo(3L,"job3"));
        set.add(new Demo(4L,"job4"));
        set.add(new Demo(5L,"job5"));
        set.add(new Demo(6L,"job6"));

        Iterator it=  set.iterator();
        while(it.hasNext()){
            System.out.println(it.next());
        }
    }
}



